package com.yunji.product.enums;

import java.util.Objects;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.product.enums
 * @Title: ProductCompareType
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-09-18 18:11:15      V1.0        HuaAo       新建类
 */

public enum ProductCompareType {

    OLD_AGENT_PRODUCT(0, "旧代理商商品"),
    NEW_AGENT_PRODUCT(1, "新代理商商品"),
    CONTAINER_PRODUCT(2, "货柜商品"),
    ALL_PRODUCT(3, "所有商品");
    private final Integer code;
    private final String text;

    ProductCompareType(Integer type, String info) {
        this.code = type;
        this.text = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(Integer code) {
        ProductCompareType[] enums = ProductCompareType.values();
        for (ProductCompareType e : enums) {
            if (Objects.equals(e.code, code)) {
                return e.text;
            }
        }
        return null;
    }
}